package com.kzx.blog.config.model;

/**
 * @author kongz
 * @version 1.0 2021/11/23 10:49
 * @description 异常枚举类
 */
public enum FailedInfo {

    SUCCESS(200, "请求成功"),
    ERROR_TOKEN(401, "用户授权认证失败，客户端请求参数token信息无效"),
    EMPTY_TOKEN(401, "用户授权认证失败，客户端请求参数中无token信息"),

    ILLEGAL_PARAM(10001, "不合法的参数传入"),

    FAILED_LOGIN(10002, "登录失败,账号或密码错误"),
    ERROR_DELETE(10003, "删除失败, 请稍后重试"),
    ERROR_INSERT(10004, "插入失败, 请稍后重试"),
    ERROR_UPDATE(10005, "更新失败, 请稍后重试"),

    NO_PERMISSION(10006, "你没有权限执行此操作"),

    ERROR_UPLOAD(10007, "文件上传失败"),
    EMPTY_BLOG(10008, "博客不存在"),
    ;
    private int errorCode;
    private String errorMsg;

    FailedInfo(int errorCode, String errorMsg) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }
}
